class UserObserver < ActiveRecord::Observer
  def after_create(user)
    if user.activated_at == nil
      UserNotifier.deliver_signup_notification(user)     
    end
  end

  def after_save(user)
    #UserNotifier.deliver_invitation_notification(user) if user.recently_invited?
    UserNotifier.deliver_activation(user) if user.recently_activated?  
    UserNotifier.deliver_forgot_password(user) if user.recently_forgot_password?
    UserNotifier.deliver_reset_password(user) if user.recently_reset_password?
  end
end
